GIS Map Settings
Datafor's GIS map component supports "Gaode Map", "Open Street Map", and "Google" map. When using these GIS map services, you need to set the tile address, geocoding API, and API key provided by different GIS map service providers.
Settings
Tile Address
The tile address of a GIS map is a URL address consisting of a series of numbers and characters, which contains the coordinate information of the map display area, the map zoom level, and the map type parameters, so that the map tiles can be dynamically loaded on the web.
The tile address format for OpenStreetMap is:
https://a.tile.openstreetmap.org/{z}/{x}/{y}.png
Here, {z} represents the zoom level, and {x} and {y} represent the coordinates of the tile at that level.
The tile address format for Google maps is:
http://mt2.google.com/vt/lyrs=r&scale=2&gl=en&x={x}&y={y}&z={z}
Here, {z} represents the zoom level, {x} and {y} represent the coordinates of the tile at that level, and {style} represents the map style.
The tile address format for Gaode maps is:
http://wprd04.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scl=2&style=7<ype=7&x={x}&y={y}&z={z}
Here, {s} represents the number of the tile server, {style} represents the map style, {x} and {y} represent the coordinates of the tile at that level, and {z} represents the zoom level.
Geocoding API
The geocoding address of a GIS map is the process of converting descriptive information about a geographic location (such as an address, street, city, province, etc.) into geographic coordinates.
In a GIS map, the geocoding address is implemented by calling the API interface of the geocoding service provider. The geocoding service provider will search for the matching geographic location from its large amount of map data based on the input address information, and return the corresponding latitude and longitude coordinates, so that it can be displayed or used for other operations on the map.
The geocoding API for OpenStreetMap is Nominatim.
Forward geocoding query (converting address information to coordinates):
https://nominatim.openstreetmap.org/search/
The geocoding API for Google Maps is a paid API, and users need to create a Google Cloud account and enable API services.
https://maps.googleapis.com/maps/api/geocode/json
The forward geocoding query (converting address information to coordinates) of Gaode maps:
https://restapi.amap.com/v3/geocode/geo
API key
The API key for a GIS map is an API key used to access a given GIS service. It is a unique identifier that allows developers to access and use GIS map services by including it in their application. The use of an API key can ensure that only authorized users can access map services, thereby protecting the security and integrity of the data.
The specific steps for applying for a GIS map API key may vary depending on the GIS service provider, but typically require the following steps:
- Choose a GIS service provider, such as Google Maps, Baidu Maps, Gaode Maps, Mapbox, etc.
- Register an account and log in to the service provider's developer center or API management page.
- Create a new project or application and choose to use the map API.
- Generate an API key and add it to the GIS map configuration of Datafor.
Settings
Enter the "GIS Map" configuration page in Datafor's "Settings".
Currently, Datafor supports the configuration of OpenStreetMap, Google Map, and Gaode Map.